

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	
	local pos = data:GetOrigin()
	local col = data:GetAngle()
	local color = Color(col.p,col.y,col.r,200)
	
	self.Entity.pos = pos
	self.Entity.color = color
	
	local emitter = ParticleEmitter( pos )
	
		// Big fast splash at top
		local particle = emitter:Add( "effects/blueflare1", self.Entity.pos )
			particle:SetDieTime( 0.5 )
			particle:SetStartAlpha( 250 )
			particle:SetEndAlpha( 5 )
			particle:SetStartSize( math.random(80,100))
			particle:SetEndSize( math.random(3,5) )
			particle:SetRoll( math.Rand( 0, 360 ) )
			particle:SetColor( self.Entity.color.r,self.Entity.color.g,self.Entity.color.b )
	
		for i=1,math.random(30,40) do
		local particle = emitter:Add( "effects/blueflare1", self.Entity.pos )
			particle:SetDieTime( math.Rand(5,6) )
			particle:SetStartAlpha( 200 )
			particle:SetEndAlpha( 0 )
			particle:SetStartSize( math.Rand(4,6) )
			particle:SetEndSize( math.Rand(0,1) )
			particle:SetRoll( math.Rand( 0, 360 ) )
			particle:SetVelocity( Vector(math.Rand(-200,200),math.Rand(-200,200),math.Rand(60,140)) )
			particle:SetColor( self.Entity.color.r,self.Entity.color.g,self.Entity.color.b )
			particle:SetGravity(Vector(0,0,-520)) //-600 is normal
			particle:SetCollide(true)
			particle:SetBounce(0.55) 
		end
			
	emitter:Finish()
	
end


/*---------------------------------------------------------
   THINK
   Returning false makes the entity die
---------------------------------------------------------*/
function EFFECT:Think( )
	return false
end


/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()

	// Do nothing - this effect is only used to spawn the particles in Init
	
end



